package com.lantosec.hmrp.modules.supplier.entity;

import java.math.BigDecimal;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.supplier.vo.SupplierContractVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 供应商合同 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-21
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SupplierContract extends BaseEntity<SupplierContractVO> {

    private static final long serialVersionUID = 1L;
    public SupplierContract(SupplierContractVO vo){
        this.contractId = vo.getContractId();
        this.contractNo = vo.getContractNo();
        this.contractName = vo.getContractName();
        this.supplierCode = vo.getSupplierCode();
        this.supplierName = vo.getSupplierName();
        this.thirdParty = vo.getThirdParty();
        this.contractType = vo.getContractType();
        this.operatorId = vo.getOperatorId();
        this.operatorName = vo.getOperatorName();
        this.signDate = vo.getSignDate();
        this.expiryDate = vo.getExpiryDate();
        this.contractSum = vo.getContractSum();
        this.paymentTerms = vo.getPaymentTerms();
        this.contractScan = vo.getContractScan();
        this.contractAttach = vo.getContractAttach();
    }

    @Override
    public SupplierContractVO convertToVO(){
        return new SupplierContractVO(this);
    }


    /**
     * 合同ID
     */
    @TableId(value = "contract_id", type = IdType.ASSIGN_UUID)
    private String contractId;

    /**
     * 合同编号
     */
    private String contractNo;

    /**
     * 合同名称
     */
    private String contractName;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 供应商名称
     */
    private String supplierName;

    /**
     * 第三方
     */
    private String thirdParty;

    /**
     * 合同类型
     */
    private String contractType;

    /**
     * 经办人ID
     */
    private String operatorId;

    /**
     * 经办人名称
     */
    private String operatorName;

    /**
     * 签订日期
     */
    private String signDate;

    /**
     * 合同终止日期
     */
    private String expiryDate;

    /**
     * 合同金额
     */
    private BigDecimal contractSum;

    /**
     * 付款条款
     */
    private String paymentTerms;

    /**
     * 合同扫描件
     */
    private String contractScan;

    /**
     * 合同附件
     */
    private String contractAttach;


    public enum ColName {
        contract_id, contract_no, contract_name, supplier_code, supplier_name, third_party, contract_type, operator_id, operator_name, sign_date, expiry_date, contract_sum, payment_terms, contract_scan, contract_attach, 
    }
}
